<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<s:include value="../include.jsp"></s:include>

<%
String content = (String)request.getAttribute("content");
if(null == content)
  content = " "; 
 %>
<html>
<head>
	<title>编辑图书</title>
	  <style type="text/css">
        table {
            border: 1px solid black;
            border-collapse: collapse;
        }
        
        table thead tr th {
            border: 1px solid black;
            padding: 3px;
            background-color: #cccccc;
        }
        
        table tbody tr td {
            border: 1px solid black;
            padding: 3px;
        }
    </style>
	<s:head/>
	<script>
	function submitForm(){
	   document.editForm.submit(); 
	}
	</script>
</head>
<body>
 <s:form name="editForm" action="saveNews" validate="true">
<table align="center" width="100%">
<tr>
<td colspan=2 nowrap>
	 <h2>
        <s:if test="null == news">
            新增新闻
        </s:if>
        <s:else>
            编辑新闻
        </s:else>
    </h2>
    <a href="javaScript:submitForm()">保存</a>&nbsp;<a href="<s:url action="listNews"/>">全部</a>&nbsp;<a href="<s:url action="listNews"/>">返回</a></td>
    </tr>
         <s:textfield label="标题" name="news.title"/><s:hidden name="news.newsid" value="%{newsid}"/> 
		 <s:textfield label="作者" name="news.draftUser"/> 
		 <s:datetimepicker label="日期" name="news.addDate"></s:datetimepicker> 
	<tr>
		<td colspan=3> 
		<FCK:editor instanceName="news.content" height="500pt">
         <jsp:attribute name="value"><%=content%></jsp:attribute>
         </FCK:editor>  
		</td>
	</tr>  
	</table>
	</s:form>


</body>
</html>